using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Lesson9 : MonoBehaviour
{
    //背景音乐
    public Button btnBkPlay;
    public Button btnBkPuase;
    public Button btnBkUnPuase;
    public Button btnBkStop;
    public Slider sliderBk;
    //音效
    public Button btnSoundPlay;
    public Slider sliderSound;
    void Start()
    {
        //背景音乐
        btnBkPlay.onClick.AddListener(() =>
        {
            MusicMgr.GetInstance().PlayeBKMusic("bk1");
        });
        btnBkPuase.onClick.AddListener(() =>
        {
            MusicMgr.GetInstance().PauseBkMusic();
        });
        btnBkUnPuase.onClick.AddListener(() =>
        {
            MusicMgr.GetInstance().UnPauseBkMusic();
        });
        btnBkStop.onClick.AddListener(() =>
        {
            MusicMgr.GetInstance().StopBKMusic();
        });
        sliderBk.onValueChanged.AddListener((value) =>
        {
            MusicMgr.GetInstance().ChangeBkVolume(value);
        });
        //音效
        btnSoundPlay.onClick.AddListener(() =>
        {
            MusicMgr.GetInstance().PlayeSound("sound1");
        });
        sliderSound.onValueChanged.AddListener((value) =>
        {
            MusicMgr.GetInstance().ChangeSoundVolume(value);
        });
    }
}
